import request from '@/utils/request'

export function getMenuList(query) {
  return request({
    url: '/menu/list',
    method: 'get',
    params: query
  })
}

export function getTreeList(query) {
  return request({
    url: '/menu/cate',
    method: 'get',
    params: query
  })
}

export function handleMenu(data) {
  return request({
    url: '/menu/handle',
    method: 'post',
    data
  })
}

export function deleteMenu(id) {
  return request({
    url: `/menu/delete/${id}`,
    method: 'delete'
  })
}

export function getDndList() {
  return request({
    url: '/menu/dndlist',
    method: 'get'
  })
}

export function dndListHandle(data) {
  return request({
    url: '/menu/dndlist/handle',
    method: 'post',
    data
  })
}
